// @ts-ignore
/* eslint-disable */
import request from '@/utils/request.ts'

/** 此处后端没有提供注释 POST /user/addUserToRole */
export async function addUserToRole(body: API.UserAssignRoleDTO, options?: { [key: string]: any }) {
  return request<API.BaseResponseString>('/user/addUserToRole', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 DELETE /user/deleteUser/${param0} */
export async function deleteUser(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.deleteUserParams,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params
  return request<API.BaseResponseString>(`/user/deleteUser/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 GET /user/findAllUsers */
export async function findAllUsers(options?: { [key: string]: any }) {
  return request<API.BaseResponseListSysUser>('/user/findAllUsers', {
    method: 'GET',
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 GET /user/getAllUserRoles */
export async function getAllUserRoles(options?: { [key: string]: any }) {
  return request<API.BaseResponseMapLongListLong>('/user/getAllUserRoles', {
    method: 'GET',
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 GET /user/getRoleIds */
export async function getRoles(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getRolesParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseListLong>('/user/getRoleIds', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 GET /user/getUser */
export async function getUser(options?: { [key: string]: any }) {
  return request<API.BaseResponseSysUser>('/user/getUser', {
    method: 'GET',
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 GET /user/getUserById */
export async function getUserById(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getUserByIdParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseSysUser>('/user/getUserById', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 PUT /user/resetPassword/${param0} */
export async function resetPassword(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.resetPasswordParams,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params
  return request<API.BaseResponseString>(`/user/resetPassword/${param0}`, {
    method: 'PUT',
    params: { ...queryParams },
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 PUT /user/updatePassword */
export async function updatePassword(
  body: API.UpdatePasswordDTO,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseString>('/user/updatePassword', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 PUT /user/updateUser */
export async function updateUser(body: API.SysUser, options?: { [key: string]: any }) {
  return request<API.BaseResponseString>('/user/updateUser', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}
